#include <bits/stdc++.h>
using namespace std;

class Solution
{
public:
    int main()
    {
        int n, k;
        cin >> n >> k;
        int allSum = n * (n + 1) / 2;
        int dividableCount = n / k;
        int nondividableCount = n - dividableCount;
        int dividableSum = dividableCount * (dividableCount + 1) * k / 2;
        int nondividableSum = allSum - dividableSum;
        cout << fixed << setprecision(1) << (1.0 * dividableSum / dividableCount) << " "
             << fixed << setprecision(1) << (1.0 * nondividableSum / nondividableCount);
        return 0;
    }
};

#ifndef __LOCAL_TEST__
int main()
{
    return Solution().main();
}
#endif